<?php use_helper('jQuery')?>
<script type="text/javascript">
    $(document).ready(function() {
	$("#slider").slideViewerPro({
            leftButtonInner: "-",
            rightButtonInner: "+",
            thumbs: 4, 
            thumbsPercentReduction: 22,
            galBorderWidth: 0,
            galBorderColor: "aqua",
            thumbsTopMargin: 0,
            thumbsRightMargin: 0,
            thumbsBorderWidth: 2,
            thumbsActiveBorderColor: "#cc0066",
            thumbsActiveBorderOpacity: 0.8,
            thumbsBorderOpacity: 0,
            buttonsTextColor: "#707070",
            buttonsWidth: 40,
            leftButtonInner: "<img src='/images/anterior2.png' />",
            rightButtonInner: "<img src='/images/proximo2.png' />",
            autoslide: false, 
            typo: true
	});
    });
</script>
<?php if($nominations->count()): ?>
    <div class="nominations-title span-17 last">
        <h2>Mis nominaciones:</h2>
    </div>
    <div class="nominations span-17 last">
        <?php 
            $i = 1;
            foreach ($nominations as $nomination) :
        ?>
            <div class="nomination span-8 last <?php echo $i%2 == 0 ? '' : 'append-1'?>">
                <div class="span-3"><h4><b><?php echo $nomination->getCategory().':' ?></b></h4></div>
                <div class="span-5 last"><h4><?php echo $nomination->getCandidate() ?></h4></div>
            </div>
        <?php 
            $i++;
            endforeach; 
        ?>
    </div>
    <div class="social-share prepend-top span-17 last">
        <div class="social-share-button span-2">
            <a href="https://twitter.com/share" class="twitter-share-button" 
               data-url="<?php echo $short_url ?>" 
               data-text="Estos son mis nominados a #LoMejorDeCcs 2011" 
               data-count="none" data-via="hoyquehay" data-lang="es"
           >
                Tweet
            </a>
            <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
        </div>
        <div class="social-share-button span-2">
            <div id='fb-root'></div>
            <script src='http://connect.facebook.net/en_US/all.js'></script>
            <a href="#" onclick='postToFeed(); return false;'><img alt="Facebook Share" src="/images/fb_share_button.jpg" /></a>

            <script type="text/javascript"> 
                FB.init({appId: "<?php echo $fb_app_id ?>", status: true, cookie: true});

                function postToFeed() {
                    var obj = {
                        method: 'feed',
                        link: '<?php echo url_for('show_user_nominations', $sf_user->getGuardUser(), true); ?>',
                        picture: 'http://lomejorde.hoyquehay.com.ve/images/logocompleto.png',
                        name: 'Lo Mejor de Caracas 2011',
                        caption: 'Lo Mejor de Caracas 2011: Nomina lo mejor de la ciudad en distintas categorias que representan la movida caraqueña.',
                        description: 'Estos son mis nominados a Lo Mejor de Caracas 2011.'
                    };

                    function callback(response) {
                        document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
                    }

                    FB.ui(obj, callback);
                }
            </script> 
        </div>
    </div>
<?php endif; ?>
<?php if($pending_categories->count()):?>
    <div class="pending-categories-title span-17 last">
        <h2>Aún no has nominado en estas categorías:</h2>
    </div>
    <div class="pending-categories span-17 last">
        <div id="slider">
            <ul>
                <?php foreach ($pending_categories as $category) : ?>
                    <li>
                        <?php echo jq_link_to_remote(
                            '<img width="670" height="180" src="/uploads/'.$category->getImage().'" alt="'.$category.' - '.$category->getDescription().'" />',
                            array(
                                'update' => 'main-content',
                                'url'    => url_for('nominaciones_new', $category),
                                'before' => 'showLoader();',
                                'complete' => 'hideLoader();',
                                'script' => true
                            )); 
                        ?>
                    </li>
                <?php endforeach; ?>
            </ul>
        </div>
    </div>
<?php endif; ?>